﻿package com.game.view.layer.loadingBar
{
	import com.dusk.util.ResUtil;
	import com.dusk.util.TextUtil;
	import com.game.data.constant.ConfigConst;
	import com.greensock.TweenMax;
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class LoadingBar1 extends LoadingBarBase
	{
		public function LoadingBar1()
		{
		}
		
		public var bar:MovieClip;
		
		public var tips:MovieClip;
		
		public var logo:TextField;
		
		override protected function beforeAdded():void
		{
			var loadingBar:MovieClip = ResUtil.getLayerView("LoadingBar1") as MovieClip;
			TextUtil.redrawTxt(loadingBar);
			bar = loadingBar.getChildByName("bar") as MovieClip;
			bar.gotoAndStop(1);
			tips = loadingBar.getChildByName("tips") as MovieClip;
			tips.gotoAndStop(1);
			logo = loadingBar.getChildByName("logo") as TextField;
			logo.text = "造梦西游之三界纵横" + ConfigConst.GAME_VERSION_NAME;
			addChild(loadingBar);
			changeTips();
			TweenMax.delayedCall(8, function (param1:LoadingBar1):*
			{
				param1.changeTips();
			}, [this]);
		}
		
		public function changeTips():void
		{
			if (tips.currentFrame < tips.totalFrames)
			{
				tips.gotoAndStop(tips.currentFrame + 1);
			}
			else
			{
				tips.gotoAndStop(1);
			}
			TweenMax.delayedCall(8, function (param1:LoadingBar1):*
			{
				param1.changeTips();
			}, [this]);
		}
		
		override protected function setProcess(param1:Object):void
		{
			bar.gotoAndStop(param1.curPercent);
		}
	}
}
